*************
**// Panel A
*************
**// Reproduction
clear
use "C:\Users\Samangi\Documents\Datasets\Chapter Three\Z&Hcompetition.dta"
set more off
gen double invSEPCC = 1/SEPCC
gen double lnobs = ln(Samplesize)
gen double invlnobs=1/lnobs
xtset IDStudy
eststo: xtreg t invSEPCC, fe vce(cluster IDStudy)
eststo: xtreg t invSEPCC if reviewed_journal==1, fe vce(cluster IDStudy)
eststo: xtivreg t (invSEPCC=invlnobs), fe
eststo: xtivreg t (invSEPCC=invlnobs) if reviewed_journal==1, fe
eststo: xtreg t invSEPCC [pweight=investperst], fe vce(cluster IDStudy)
eststo: xtreg t invSEPCC [pweight=investperst] if reviewed_journal==1, ///
fe vce(cluster IDStudy)

**// Repetition
clear
use "C:\Users\Samangi\Documents\Datasets\Chapter Three\598_Rep.dta"
set more off
gen double invSEPCC = 1/SEPCC
gen double lnobs = ln(Samplesize)
gen double invlnobs=1/lnobs
xtset IDStudy
eststo: xtreg t invSEPCC, fe vce(cluster IDStudy)
eststo: xtreg t invSEPCC if reviewed_journal==1, fe vce(cluster IDStudy)
eststo: xtivreg t (invSEPCC=invlnobs), fe
eststo: xtivreg t (invSEPCC=invlnobs) if reviewed_journal==1, fe
eststo: xtreg t invSEPCC [pweight=investperst], fe vce(cluster IDStudy)
eststo: xtreg t invSEPCC [pweight=investperst] if reviewed_journal==1, ///
fe vce(cluster IDStudy)


*************
**// Panel B
*************
**// OLS
clear
use "C:\Users\Samangi\Documents\Datasets\Chapter Three\Z&Hcompetition.dta"
set more off
xtset IDStudy
gen double lnobs = ln(Samplesize)
ivreg2 PCC SEPCC dummies Hstatistic developed undeveloped Logit lnobs ///
citations firstpub quadratic Boone IFrecursive regulation OLS ///
reviewed_journal [pweight=investperst], cluster (IDStudy)

clear
use "C:\Users\Samangi\Documents\Datasets\Chapter Three\598_Rep.dta"
set more off
xtset IDStudy
gen double lnobs = ln(Samplesize)
ivreg2 PCC SEPCC Hstatistic  Logit lnobs citations reviewed_journal firstpub ///
global developed dummies RE quadratic DtoD Lerner sampleyear ///
ownership someAveraged [pweight=investperst], cluster (IDStudy)
